home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.mactech.com 2010
/
ftp.mactech.com.tar
/
ftp.mactech.com
/
thinkref
/
archive
/
THINKPascalUH2.1.sea
/
THINKPas Univ Hdr 2.1
/
Interfaces
/
ObjIntf.p
< prev
next >
Wrap
Text File
|
1995-09-13
|
2KB
|
73 lines
{ Converted with MPW2TPas Tuesday, September 12, 1995 7:59:53 PM }
{}
{ File: ObjIntf.p}
{}
{ Copyright: © 1983-1993 by Apple Computer, Inc.}
{ All rights reserved.}
{}
{ Version: System 7.1 for ETO #11}
{ Created: Tuesday, March 30, 1993 18:00}
{}
{}
unit ObjIntf;
interface
{$IFC UNDEFINED UsingObjIntf}
{$SETC UsingObjIntf := 1}
type
TObject = object
function ShallowClone: TObject;
{Lowest level method for copying an object; should not be overridden}
{ except in very unusual cases. Simply calls HandToHand to copy}
{ the object data.}
function Clone: TObject;
{Defaults to calling ShallowClone; can be overridden to copy objects}
{ refered to by fields.}
procedure ShallowFree;
{Lowest level method for freeing an object; should not be overridden}
{ except in very unusual cases. Simply calls DisposHandle to}
{ free the object data.}
procedure Free;
{Defaults to calling ShallowFree; can be overridden to free objects }
{ refered to by fields.}
end;
{$ENDC}
{ UsingObjIntf }
implementation
function TObject.ShallowClone;
var
result: Handle;
begin
result := Handle(SELF);
if HandToHand(result) <> noErr then
begin
{ report some sort of error? }
result := nil
end;
ShallowClone := TObject(result);
end;
function TObject.Clone;
begin
Clone := SELF.ShallowClone;
end;
procedure TObject.ShallowFree;
begin
DisposHandle(Handle(SELF));
end;
procedure TObject.Free;
begin
SELF.ShallowFree;
end;
end.